package leetcode_41_60;

import leetcode_21_40.divide_29;
import org.junit.Test;

public class Test3 {
    @Test
    //缺失的第一个正数
    public void test41(){
        int[] a={2,1};
        System.out.println(new firstMissingPositive_41().firstMissingPositive2(a));
    }

    @Test
    //接雨水
    public void test42(){
        int[] a={0,1,0,2,1,0,1,3,2,1,2,1};
        System.out.println(new trap_42().trap(a));
    }

    @Test
    //字符串相乘
    public void test43(){
        System.out.println(new multiply_43().multiply("999","999"));
    }

    @Test
    //通配符匹配?*
    public void test44(){
        System.out.println(new isMatch_44().isMatch2("abcdec","a*c"));
    }

    @Test
    //跳跃游戏 II
    public void test45(){
        int[] a={5,9,3,2,1,0,2,3,3,1,0,0};
        System.out.println(new jump_45().jump3(a));
    }

    @Test
    //全排列
    //1ms
    public void test46(){
        int[] a={4,3,2,1};
        System.out.println(new permute_46().permute(a));
    }

    @Test
    // 全排列 II
    // 沿用46即可，1ms
    public void test47(){
        int[] a={1,1,2};
        System.out.println(new permute_46().permute(a));
    }

    @Test
    // 旋转图像
    public void test48(){
        int[][] a={{1,2,3},{4,5,6},{7,8,9}};
        new rotate_48().rotate(a);
    }

    @Test
    // 字母异位词分组
    public void test49(){
        String[] a={"ac","c"};
        System.out.println(new groupAnagrams_49().groupAnagrams(a));
    }

    @Test
    //实现 pow(x, n)
    public void test50(){
        System.out.println(myPow_50.myPow(2,-3));
    }

    @Test
    //N 皇后
    public void test51(){
        System.out.println(new solveNQueens_51().solveNQueens2(4));
    }

    @Test
    //N 皇后 2
    public void test52(){
        System.out.println(new totalNQueens_52().totalNQueens2(4));
    }

    @Test
    //最大子数组和
    public void test53(){
        int[] a={-2,1,-3,4,-1,2,1,-5,4};
        System.out.println(new maxSubArray_53().maxSubArray(a));
    }

    @Test
    //螺旋矩阵
    public void test54(){
        int[][] a={{1,2,3},{4,5,6},{7,8,9}};
        System.out.println(new spiralOrder_54().spiralOrder(a));
    }

    @Test
    //跳跃游戏
    public void test55(){
        int[] a={2,0,0};
        System.out.println(new canJump_55().canJump2(a));
    }

    @Test
    //合并区间
    public void test56(){
        int[][] a={{1,3},{4,6},{5,9}};
        new merge_56().merge(a);
    }

    @Test
    //插入区间
    public void test57(){
        int[][] a={{1,2},{3,5},{6,7},{8,10},{12,16}};
        int[] b={4,8};
       new insert_57().insert2(a,b);
    }

    @Test
    //最后一位字符串的长度
    public void test58(){
        String a="   fly me   to   the moon  ";
        System.out.println(new lengthOfLastWord_58().lengthOfLastWord(a));
    }

    @Test
    //螺旋矩阵 II
    public void test59(){
        new generateMatrix_59().generateMatrix(4);
    }

    @Test
    // 排列序列
    public void test60(){
        System.out.println(new getPermutation_60().getPermutation(5,8));
    }
}

